<link rel="import" href="../../bower_components/polymer/polymer-element.html">

<dom-module id="to-do">
  <template>
    <style>
      :host {
        display: block;
      }
      span{
        cursor: pointer;
      }
    </style>
    <span class="todo">[[todo.content]]<a title="删除" on-click="del">[X]</a></span>
  </template>

  <script>
    /**
     * @customElement
     * @polymer
     */
    class ToDo extends Polymer.Element {
      static get is() { return 'to-do'; }
      static get properties() {
        return {
        }
      }
      del(){
        this.dispatchEvent(new CustomEvent('del',{detail:{id:this.todo.id}}));
      }
    }

    window.customElements.define(ToDo.is, ToDo);
  </script>
</dom-module>
